home *** CD-ROM | disk | FTP | other *** search
Text File | 1988-10-31 | 30.2 KB | 1,340 lines |
- -- background: 2580 from stack: in.1
- -- bmap block id: 3656
- -- flags: 4000
- -- background id: 0
- -- name:
- ----- HyperTalk script -----
- on openBackground
- set cursor to busy
- global firstLineField,lastLineField,sellToField
- put 5 into firstLineField
- put 36 into lastLineField
- end openBackground
-
- function checkInvoiceMaster
- get the short name of this card
- if it is "Invoice Master" then
- return true
- else
- return false
- end if
- end checkInvoiceMaster
-
- on openCard
- global newInvoice,changedInvoice,deleteFlag
- if deleteFlag is not empty then exit openCard
- -- changedInvoice set if amountDue changed
- if newInvoice then
- put false into newInvoice
- else
- put false into changedInvoice
- end if
- end openCard
-
- on newCard
- global leadingZeros,currentCustomerNumber,firstLineField, newInvoice,changedInvoice
- put true into newInvoice
- put true into changedInvoice
- set cursor to busy
- set the name of this card to empty
- put the abbrev date into field "Date"
- put currentCustomerNumber into field "Customer Number"
- put "C"¤tCustomerNumber into customer
- set numberFormat to leadingZeros
- get field "Highest Invoice Number" of card "Preferences"
- add 1 to it
- put it into field "Invoice Number"
- set the name of this card to "I"&it
- put it into field "Highest Invoice Number" of card "Preferences"
- get field "Sell to:" of card customer
- put it into field "Sell to:"
- get field "Ship to:" of card customer
- put it into field "Ship to:"
- put "0.00" into field "Amount Due"
- click at loc of field firstLineField
- end newCard
-
- function findInvoiceLine customer,whichField
- global unitFormat
- set cursor to busy
- -- Assume done only if not "Invoice Master"
- set numberFormat to unitFormat -- restore if number fields closed
- put empty into foundLine
- put field "Invoice Number" into InvoiceNumber
- get field whichField of card Customer
- repeat with i=1 to the number of lines of it
- set cursor to busy
- if word 1 of line i of it = InvoiceNumber then
- put i into foundLine
- exit repeat
- else
- add 1 to i
- end if
- end repeat
- return foundLine
- end findInvoiceLine
-
- function findNextInvoiceLine customer,whichField
- global unitFormat
- -- find first invoice with greater number
- -- Assume done only if not "Invoice Master"
- set cursor to busy
- set numberFormat to unitFormat -- restore if number fields closed
- put empty into foundLine
- put field "Invoice Number" into InvoiceNumber
- get field whichField of card customer
- repeat with i=1 to the number of lines of it
- set cursor to busy
- if word 1 of line i of it > InvoiceNumber then
- put i into foundLine
- exit repeat
- else
- add 1 to i
- end if
- end repeat
- return foundLine
- end findNextInvoiceLine
-
- on deleteCard
- global deleteFlag
- set cursor to busy
- if deleteFlag = "All" then exit deleteCard
- if (deleteFlag = "invoice") or (deleteFlag is empty) then
- -- delete invoice from customer
- get field "Customer Number"
- put "C"&it into customer
- put number of field "Unpaid Invoices" of card customer into fieldNumber
- put findInvoiceLine(customer,fieldNumber) into oldLine
- if oldLine is not empty then
- delete line oldLine of field fieldNumber of card customer
- else
- put number of field "Paid Invoices" of card customer into fieldNumber
- put findInvoiceLine(customer,fieldNumber) into oldLine
- if oldLine is not empty then
- delete line oldLine of field fieldNumber of card customer
- end if
- end if
- end if
- get the number of this card
- if it+1 = the number of card "Customer Master" then
- if it-1 Γëá the number of card "Invoice Master" then
- go card it-1 -- normally goes to next card
- else
- go card customer -- return to customer card if last invoice
- end if
- end if
- end deleteCard
-
- on closeCard
- global findMode,deleteFlag,changedInvoice
- if deleteFlag is not empty then exit closeCard
- if not changedInvoice then exit closeCard
- if findMode then exit closeCard
- if checkInvoiceMaster() then exit closeCard
- set cursor to busy
- get field "Customer Number"
- put "C"&it into Customer
- put number of field "Unpaid Invoices" of card Customer into unpaidInvoices
- put number of field "Paid Invoices" of card Customer into paidInvoices
- if field "Amount Due" Γëá 0 then
- put field "Amount Due" into invoiceText
- put unpaidInvoices into fieldNumber
- put findInvoiceLine(customer,paidInvoices) into oldLine
- if oldLine is not empty then
- delete line oldLine of field paidInvoices of card Customer
- end if
- else
- put field "Total" into invoiceText
- put paidInvoices into fieldNumber
- put findInvoiceLine(customer,unpaidInvoices) into oldLine
- if oldLine is not empty then
- delete line oldLine of field unpaidInvoices of card Customer
- end if
- end if
- if invoiceText is empty then
- put "0.00" into invoiceText
- end if
- repeat while number of characters in invoiceText < 9
- put " "&invoiceText into invoiceText
- end repeat
- put field "Invoice Number"&&invoiceText into invoiceText
- get field "Date"
- convert it to short date
- put invoiceText&&it into invoiceText
- put findInvoiceLine(customer,fieldNumber) into invoiceLine
- if invoiceLine is empty then
- put findNextInvoiceLine(customer,fieldNumber) into invoiceLine
- if invoiceLine is empty then
- get the number of lines of field fieldNumber of card Customer
- add 1 to it
- put it into invoiceLine
- else
- get line invoiceLine of field fieldNumber of card Customer
- put invoiceText&RETURN&it into invoiceText
- end if
- end if
- put invoiceText into line invoiceLine of field fieldNumber of card Customer
- end closeCard
-
- on showButtons
- repeat with i=1 to the number of bkgnd buttons
- show bkgnd button i
- end repeat
- end showButtons
-
- on Idle
- global printingInvoice
- if printingInvoice then
- showButtons
- put false into printingInvoice
- end if
- end Idle
-
- on setUnitFormat
- global unitFormat
- put the number of the target into ourField
- set the numberFormat to unitFormat
- add 0 to field ourField
- end setUnitFormat
-
- on setDollarFormat
- global dollarsAndCents
- put the number of the target into ourField
- set the numberFormat to dollarsAndCents
- add 0 to field ourField
- end setDollarFormat
-
- on calcTax
- get field "Sales Tax Rate"
- multiply it by field "SubTotal"
- divide it by 100
- put it into field "Sales Tax"
- end calcTax
-
- on calcTotal
- global dollarsAndCents,changedInvoice
- set numberFormat to dollarsAndCents
- put field "Amount Due" into oldAmountDue
- put field "Subtotal" into sum
- if the highlight of bkgnd button "Shipping" then
- add field "Shipping" to sum
- end if
- if the highlight of bkgnd button "Sales Tax" then
- calcTax
- add field "Sales Tax" to sum
- end if
- put sum into field "Total"
- subtract field "Amount Received" from sum
- put sum into field "Amount Due"
- if sumΓëáoldAmountDue then
- put true into changedInvoice
- end if
- end calcTotal
-
- on calcSubtotal
- global dollarsAndCents,unitFormat,firstLineField,lastLineField
- set numberFormat to unitFormat
- put firstLineField+3 into i
- set numberFormat to dollarsAndCents
- put 0 into sum
- repeat while i<=lastLineField
- add field i to sum
- set numberFormat to unitFormat
- add 4 to i
- set numberFormat to dollarsAndCents
- end repeat
- put sum into field "Subtotal"
- calcTotal
- end calcSubtotal
-
- on calcLine -- Calculate quantity*unitPrice for line
- -- When either field is closed
- global dollarsAndCents,unitFormat,firstLineField,lastLineField
- set numberFormat to unitFormat
- get the number of the target
- put it into ourField
- subtract firstLineField from it
- put trunc(it/4) into quotient
- put it-4*quotient into it
- put ourField+2-it into unitCostField
- put unitCostField-2 into quantityField
- put unitCostField+1 into priceField
- set numberFormat to dollarsAndCents
- put field unitCostField into unitCost
- if unitCost is not empty then
- put field quantityField into quantity
- if quantity is empty then
- put 1 into quantity
- end if
- put quantity*unitCost into price
- put price into field priceField
- else
- put empty into field priceField
- end if
- calcSubtotal
- end calcLine
-
- on returnToCustomer
- set cursor to busy
- if checkInvoiceMaster() then exit returnToCustomer
- get field "Customer Number"
- go card "C"&it
- end returnToCustomer
-
- on controlKey keyValue
- set cursor to busy
- if keyValue = 3 then -- C
- returnToCustomer
- else
- pass controlKey keyValue
- end if
- end controlKey
-
- on arrowKey direction
- set cursor to busy
- if direction="left" then
- click at loc of bkgnd button "Left Arrow"
- exit arrowKey
- else
- if direction="right" then click at loc of bkgnd button "Right Arrow"
- end if
- end arrowKey
-
-
-
- -- part 1 (field)
- -- low flags: 01
- -- high flags: 0000
- -- rect: left=75 top=65 right=82 bottom=131
- -- title width / last selected line: 0
- -- icon id / first selected line: 0 / 0
- -- text alignment: 0
- -- font id: 3
- -- text size: 10
- -- style flags: 256
- -- line height: 13
- -- part name: Invoice Number
-
-
- -- part 2 (field)
- -- low flags: 01
- -- high flags: 0000
- -- rect: left=360 top=65 right=82 bottom=494
- -- title width / last selected line: 0
- -- icon id / first selected line: 0 / 0
- -- text alignment: 0
- -- font id: 3
- -- text size: 10
- -- style flags: 256
- -- line height: 13
- -- part name: Date
-
-
- -- part 3 (field)
- -- low flags: 01
- -- high flags: 6002
- -- rect: left=10 top=96 right=157 bottom=225
- -- title width / last selected line: 0
- -- icon id / first selected line: 0 / 0
- -- text alignment: 0
- -- font id: 3
- -- text size: 10
- -- style flags: 0
- -- line height: 13
- -- part name: Sell to:
-
-
- -- part 4 (field)
- -- low flags: 01
- -- high flags: 6002
- -- rect: left=281 top=96 right=157 bottom=496
- -- title width / last selected line: 0
- -- icon id / first selected line: 0 / 0
- -- text alignment: 0
- -- font id: 3
- -- text size: 10
- -- style flags: 0
- -- line height: 13
- -- part name: Ship to:
-
-
- -- part 5 (field)
- -- low flags: 00
- -- high flags: 0002
- -- rect: left=45 top=168 right=184 bottom=88
- -- title width / last selected line: 0
- -- icon id / first selected line: 0 / 0
- -- text alignment: 65535
- -- font id: 3
- -- text size: 10
- -- style flags: 0
- -- line height: 13
- -- part name: Units 1
- ----- HyperTalk script -----
- on closeField
- setunitFormat
- CalcLine
- end closeField
-
-
- -- part 6 (field)
- -- low flags: 00
- -- high flags: 0002
- -- rect: left=87 top=168 right=184 bottom=346
- -- title width / last selected line: 0
- -- icon id / first selected line: 0 / 0
- -- text alignment: 0
- -- font id: 3
- -- text size: 10
- -- style flags: 0
- -- line height: 13
- -- part name: Item 1
-
-
- -- part 7 (field)
- -- low flags: 00
- -- high flags: 0002
- -- rect: left=345 top=168 right=184 bottom=413
- -- title width / last selected line: 0
- -- icon id / first selected line: 0 / 0
- -- text alignment: 65535
- -- font id: 3
- -- text size: 10
- -- style flags: 0
- -- line height: 13
- -- part name: Item Price 1
- ----- HyperTalk script -----
- on closeField
- setDollarFormat
- CalcLine
- end closeField
-
-
- -- part 9 (field)
- -- low flags: 01
- -- high flags: 0002
- -- rect: left=412 top=168 right=184 bottom=480
- -- title width / last selected line: 0
- -- icon id / first selected line: 0 / 0
- -- text alignment: 65535
- -- font id: 3
- -- text size: 10
- -- style flags: 0
- -- line height: 13
- -- part name: Quanity Price 1
-
-
- -- part 18 (field)
- -- low flags: 00
- -- high flags: 0002
- -- rect: left=45 top=183 right=199 bottom=88
- -- title width / last selected line: 0
- -- icon id / first selected line: 0 / 0
- -- text alignment: 65535
- -- font id: 3
- -- text size: 10
- -- style flags: 0
- -- line height: 13
- -- part name: Units 1
- ----- HyperTalk script -----
- on closeField
- setunitFormat
- CalcLine
- end closeField
-
-
- -- part 19 (field)
- -- low flags: 00
- -- high flags: 0002
- -- rect: left=87 top=183 right=199 bottom=346
- -- title width / last selected line: 0
- -- icon id / first selected line: 0 / 0
- -- text alignment: 0
- -- font id: 3
- -- text size: 10
- -- style flags: 0
- -- line height: 13
- -- part name: Item 1
-
-
- -- part 20 (field)
- -- low flags: 00
- -- high flags: 0002
- -- rect: left=345 top=183 right=199 bottom=413
- -- title width / last selected line: 0
- -- icon id / first selected line: 0 / 0
- -- text alignment: 65535
- -- font id: 3
- -- text size: 10
- -- style flags: 0
- -- line height: 13
- -- part name: Item Price 1
- ----- HyperTalk script -----
- on closeField
- setDollarFormat
- CalcLine
- end closeField
-
-
- -- part 21 (field)
- -- low flags: 01
- -- high flags: 0002
- -- rect: left=412 top=183 right=199 bottom=480
- -- title width / last selected line: 0
- -- icon id / first selected line: 0 / 0
- -- text alignment: 65535
- -- font id: 3
- -- text size: 10
- -- style flags: 0
- -- line height: 13
- -- part name: Quanity Price 1
- ----- HyperTalk script -----
- on closeField
- global dollarsAndCents
- set numberFormat to dollarsAndCents
- put the number of the target into nr
- get field nr
- add 0 to it
- put it into field nr
- end closeField
-
-
- -- part 22 (field)
- -- low flags: 00
- -- high flags: 0002
- -- rect: left=45 top=198 right=214 bottom=88
- -- title width / last selected line: 0
- -- icon id / first selected line: 0 / 0
- -- text alignment: 65535
- -- font id: 3
- -- text size: 10
- -- style flags: 0
- -- line height: 13
- -- part name: Units 1
- ----- HyperTalk script -----
- on closeField
- setunitFormat
- CalcLine
- end closeField
-
-
- -- part 23 (field)
- -- low flags: 00
- -- high flags: 0002
- -- rect: left=87 top=198 right=214 bottom=346
- -- title width / last selected line: 0
- -- icon id / first selected line: 0 / 0
- -- text alignment: 0
- -- font id: 3
- -- text size: 10
- -- style flags: 0
- -- line height: 13
- -- part name: Item 1
-
-
- -- part 24 (field)
- -- low flags: 00
- -- high flags: 0002
- -- rect: left=345 top=198 right=214 bottom=413
- -- title width / last selected line: 0
- -- icon id / first selected line: 0 / 0
- -- text alignment: 65535
- -- font id: 3
- -- text size: 10
- -- style flags: 0
- -- line height: 13
- -- part name: Item Price 1
- ----- HyperTalk script -----
- on closeField
- setDollarFormat
- CalcLine
- end closeField
-
-
- -- part 25 (field)
- -- low flags: 01
- -- high flags: 0002
- -- rect: left=412 top=198 right=214 bottom=480
- -- title width / last selected line: 0
- -- icon id / first selected line: 0 / 0
- -- text alignment: 65535
- -- font id: 3
- -- text size: 10
- -- style flags: 0
- -- line height: 13
- -- part name: Quanity Price 1
- ----- HyperTalk script -----
- on closeField
- global dollarsAndCents
- set numberFormat to dollarsAndCents
- put the number of the target into nr
- get field nr
- add 0 to it
- put it into field nr
- end closeField
-
-
- -- part 26 (field)
- -- low flags: 00
- -- high flags: 0002
- -- rect: left=45 top=213 right=229 bottom=88
- -- title width / last selected line: 0
- -- icon id / first selected line: 0 / 0
- -- text alignment: 65535
- -- font id: 3
- -- text size: 10
- -- style flags: 0
- -- line height: 13
- -- part name: Units 1
- ----- HyperTalk script -----
- on closeField
- setunitFormat
- CalcLine
- end closeField
-
-
- -- part 27 (field)
- -- low flags: 00
- -- high flags: 0002
- -- rect: left=87 top=213 right=229 bottom=346
- -- title width / last selected line: 0
- -- icon id / first selected line: 0 / 0
- -- text alignment: 0
- -- font id: 3
- -- text size: 10
- -- style flags: 0
- -- line height: 13
- -- part name: Item 1
-
-
- -- part 28 (field)
- -- low flags: 00
- -- high flags: 0002
- -- rect: left=345 top=213 right=229 bottom=413
- -- title width / last selected line: 0
- -- icon id / first selected line: 0 / 0
- -- text alignment: 65535
- -- font id: 3
- -- text size: 10
- -- style flags: 0
- -- line height: 13
- -- part name: Item Price 1
- ----- HyperTalk script -----
- on closeField
- setDollarFormat
- CalcLine
- end closeField
-
-
- -- part 29 (field)
- -- low flags: 01
- -- high flags: 0002
- -- rect: left=412 top=213 right=229 bottom=480
- -- title width / last selected line: 0
- -- icon id / first selected line: 0 / 0
- -- text alignment: 65535
- -- font id: 3
- -- text size: 10
- -- style flags: 0
- -- line height: 13
- -- part name: Quanity Price 1
- ----- HyperTalk script -----
- on closeField
- global dollarsAndCents
- set numberFormat to dollarsAndCents
- put the number of the target into nr
- get field nr
- add 0 to it
- put it into field nr
- end closeField
-
-
- -- part 30 (field)
- -- low flags: 00
- -- high flags: 0002
- -- rect: left=45 top=228 right=244 bottom=88
- -- title width / last selected line: 0
- -- icon id / first selected line: 0 / 0
- -- text alignment: 65535
- -- font id: 3
- -- text size: 10
- -- style flags: 0
- -- line height: 13
- -- part name: Units 1
- ----- HyperTalk script -----
- on closeField
- setunitFormat
- CalcLine
- end closeField
-
-
- -- part 31 (field)
- -- low flags: 00
- -- high flags: 0002
- -- rect: left=87 top=228 right=244 bottom=346
- -- title width / last selected line: 0
- -- icon id / first selected line: 0 / 0
- -- text alignment: 0
- -- font id: 3
- -- text size: 10
- -- style flags: 0
- -- line height: 13
- -- part name: Item 1
-
-
- -- part 32 (field)
- -- low flags: 00
- -- high flags: 0002
- -- rect: left=345 top=228 right=244 bottom=413
- -- title width / last selected line: 0
- -- icon id / first selected line: 0 / 0
- -- text alignment: 65535
- -- font id: 3
- -- text size: 10
- -- style flags: 0
- -- line height: 13
- -- part name: Item Price 1
- ----- HyperTalk script -----
- on closeField
- setDollarFormat
- CalcLine
- end closeField
-
-
- -- part 33 (field)
- -- low flags: 01
- -- high flags: 0002
- -- rect: left=412 top=228 right=244 bottom=480
- -- title width / last selected line: 0
- -- icon id / first selected line: 0 / 0
- -- text alignment: 65535
- -- font id: 3
- -- text size: 10
- -- style flags: 0
- -- line height: 13
- -- part name: Quanity Price 1
- ----- HyperTalk script -----
- on closeField
- global dollarsAndCents
- set numberFormat to dollarsAndCents
- put the number of the target into nr
- get field nr
- add 0 to it
- put it into field nr
- end closeField
-
-
- -- part 34 (field)
- -- low flags: 00
- -- high flags: 0002
- -- rect: left=45 top=243 right=259 bottom=88
- -- title width / last selected line: 0
- -- icon id / first selected line: 0 / 0
- -- text alignment: 65535
- -- font id: 3
- -- text size: 10
- -- style flags: 0
- -- line height: 13
- -- part name: Units 1
- ----- HyperTalk script -----
- on closeField
- setunitFormat
- CalcLine
- end closeField
-
-
- -- part 35 (field)
- -- low flags: 00
- -- high flags: 0002
- -- rect: left=87 top=243 right=259 bottom=346
- -- title width / last selected line: 0
- -- icon id / first selected line: 0 / 0
- -- text alignment: 0
- -- font id: 3
- -- text size: 10
- -- style flags: 0
- -- line height: 13
- -- part name: Item 1
-
-
- -- part 36 (field)
- -- low flags: 00
- -- high flags: 0002
- -- rect: left=345 top=243 right=259 bottom=413
- -- title width / last selected line: 0
- -- icon id / first selected line: 0 / 0
- -- text alignment: 65535
- -- font id: 3
- -- text size: 10
- -- style flags: 0
- -- line height: 13
- -- part name: Item Price 1
- ----- HyperTalk script -----
- on closeField
- setDollarFormat
- CalcLine
- end closeField
-
-
- -- part 37 (field)
- -- low flags: 01
- -- high flags: 0002
- -- rect: left=412 top=243 right=259 bottom=480
- -- title width / last selected line: 0
- -- icon id / first selected line: 0 / 0
- -- text alignment: 65535
- -- font id: 3
- -- text size: 10
- -- style flags: 0
- -- line height: 13
- -- part name: Quanity Price 1
- ----- HyperTalk script -----
- on closeField
- global dollarsAndCents
- set numberFormat to dollarsAndCents
- put the number of the target into nr
- get field nr
- add 0 to it
- put it into field nr
- end closeField
-
-
- -- part 38 (field)
- -- low flags: 00
- -- high flags: 0002
- -- rect: left=45 top=258 right=274 bottom=88
- -- title width / last selected line: 0
- -- icon id / first selected line: 0 / 0
- -- text alignment: 65535
- -- font id: 3
- -- text size: 10
- -- style flags: 0
- -- line height: 13
- -- part name: Units 1
- ----- HyperTalk script -----
- on closeField
- setunitFormat
- CalcLine
- end closeField
-
-
- -- part 39 (field)
- -- low flags: 00
- -- high flags: 0002
- -- rect: left=87 top=258 right=274 bottom=346
- -- title width / last selected line: 0
- -- icon id / first selected line: 0 / 0
- -- text alignment: 0
- -- font id: 3
- -- text size: 10
- -- style flags: 0
- -- line height: 13
- -- part name: Item 1
-
-
- -- part 40 (field)
- -- low flags: 00
- -- high flags: 0002
- -- rect: left=345 top=258 right=274 bottom=413
- -- title width / last selected line: 0
- -- icon id / first selected line: 0 / 0
- -- text alignment: 65535
- -- font id: 3
- -- text size: 10
- -- style flags: 0
- -- line height: 13
- -- part name: Item Price 1
- ----- HyperTalk script -----
- on closeField
- setDollarFormat
- CalcLine
- end closeField
-
-
- -- part 41 (field)
- -- low flags: 01
- -- high flags: 0002
- -- rect: left=412 top=258 right=274 bottom=480
- -- title width / last selected line: 0
- -- icon id / first selected line: 0 / 0
- -- text alignment: 65535
- -- font id: 3
- -- text size: 10
- -- style flags: 0
- -- line height: 13
- -- part name: Quanity Price 1
- ----- HyperTalk script -----
- on closeField
- global dollarsAndCents
- set numberFormat to dollarsAndCents
- put the number of the target into nr
- get field nr
- add 0 to it
- put it into field nr
- end closeField
-
-
- -- part 42 (field)
- -- low flags: 00
- -- high flags: 0002
- -- rect: left=45 top=273 right=289 bottom=88
- -- title width / last selected line: 0
- -- icon id / first selected line: 0 / 0
- -- text alignment: 65535
- -- font id: 3
- -- text size: 10
- -- style flags: 0
- -- line height: 13
- -- part name: Units 1
- ----- HyperTalk script -----
- on closeField
- setunitFormat
- CalcLine
- end closeField
-
-
- -- part 43 (field)
- -- low flags: 00
- -- high flags: 0002
- -- rect: left=87 top=273 right=289 bottom=346
- -- title width / last selected line: 0
- -- icon id / first selected line: 0 / 0
- -- text alignment: 0
- -- font id: 3
- -- text size: 10
- -- style flags: 0
- -- line height: 13
- -- part name: Item 1
-
-
- -- part 44 (field)
- -- low flags: 00
- -- high flags: 0002
- -- rect: left=345 top=273 right=289 bottom=413
- -- title width / last selected line: 0
- -- icon id / first selected line: 0 / 0
- -- text alignment: 65535
- -- font id: 3
- -- text size: 10
- -- style flags: 0
- -- line height: 13
- -- part name: Item Price 1
- ----- HyperTalk script -----
- on closeField
- setDollarFormat
- CalcLine
- end closeField
-
-
- -- part 45 (field)
- -- low flags: 01
- -- high flags: 0002
- -- rect: left=412 top=273 right=289 bottom=480
- -- title width / last selected line: 0
- -- icon id / first selected line: 0 / 0
- -- text alignment: 65535
- -- font id: 3
- -- text size: 10
- -- style flags: 0
- -- line height: 13
- -- part name: Quanity Price 1
- ----- HyperTalk script -----
- on closeField
- global dollarsAndCents
- set numberFormat to dollarsAndCents
- put the number of the target into nr
- get field nr
- add 0 to it
- put it into field nr
- end closeField
-
-
- -- part 49 (field)
- -- low flags: 01
- -- high flags: 0000
- -- rect: left=412 top=288 right=304 bottom=480
- -- title width / last selected line: 0
- -- icon id / first selected line: 0 / 0
- -- text alignment: 65535
- -- font id: 3
- -- text size: 10
- -- style flags: 0
- -- line height: 13
- -- part name: Subtotal
- ----- HyperTalk script -----
- on closeField
- global dollarsAndCents
- set numberFormat to dollarsAndCents
- put the number of the target into nr
- get field nr
- add 0 to it
- put it into field nr
- end closeField
-
-
- -- part 50 (field)
- -- low flags: 00
- -- high flags: 0002
- -- rect: left=132 top=303 right=319 bottom=195
- -- title width / last selected line: 0
- -- icon id / first selected line: 0 / 0
- -- text alignment: 65535
- -- font id: 3
- -- text size: 10
- -- style flags: 0
- -- line height: 13
- -- part name: Shipping
- ----- HyperTalk script -----
- on closeField
- setDollarFormat
- calcTotal
- end closeField
-
-
- -- part 51 (field)
- -- low flags: 80
- -- high flags: 0002
- -- rect: left=302 top=288 right=304 bottom=346
- -- title width / last selected line: 0
- -- icon id / first selected line: 0 / 0
- -- text alignment: 65535
- -- font id: 3
- -- text size: 10
- -- style flags: 0
- -- line height: 13
- -- part name: Sales Tax Rate
- ----- HyperTalk script -----
- on closeField
- calcTax
- calcTotal
- end closeField
-
-
- -- part 52 (field)
- -- low flags: 01
- -- high flags: 0002
- -- rect: left=278 top=303 right=319 bottom=346
- -- title width / last selected line: 0
- -- icon id / first selected line: 0 / 0
- -- text alignment: 65535
- -- font id: 3
- -- text size: 10
- -- style flags: 0
- -- line height: 13
- -- part name: Sales Tax
-
-
- -- part 53 (field)
- -- low flags: 01
- -- high flags: 0000
- -- rect: left=412 top=303 right=319 bottom=480
- -- title width / last selected line: 0
- -- icon id / first selected line: 0 / 0
- -- text alignment: 65535
- -- font id: 3
- -- text size: 10
- -- style flags: 0
- -- line height: 13
- -- part name: Total
-
-
- -- part 55 (field)
- -- low flags: 00
- -- high flags: 0002
- -- rect: left=87 top=318 right=334 bottom=195
- -- title width / last selected line: 0
- -- icon id / first selected line: 0 / 0
- -- text alignment: 0
- -- font id: 3
- -- text size: 10
- -- style flags: 0
- -- line height: 13
- -- part name: Terms
-
-
- -- part 56 (field)
- -- low flags: 00
- -- high flags: 0002
- -- rect: left=278 top=318 right=334 bottom=346
- -- title width / last selected line: 0
- -- icon id / first selected line: 0 / 0
- -- text alignment: 65535
- -- font id: 3
- -- text size: 10
- -- style flags: 0
- -- line height: 13
- -- part name: Amount Received
- ----- HyperTalk script -----
- on closeField
- SetDollarFormat
- CalcTotal
- end closeField
-
-
- -- part 57 (field)
- -- low flags: 01
- -- high flags: 0000
- -- rect: left=412 top=318 right=334 bottom=480
- -- title width / last selected line: 0
- -- icon id / first selected line: 0 / 0
- -- text alignment: 65535
- -- font id: 3
- -- text size: 10
- -- style flags: 0
- -- line height: 13
- -- part name: Amount Due
-
-
- -- part 58 (button)
- -- low flags: 00
- -- high flags: 0005
- -- rect: left=211 top=301 right=319 bottom=229
- -- title width / last selected line: 0
- -- icon id / first selected line: 0 / 0
- -- text alignment: 1
- -- font id: 0
- -- text size: 12
- -- style flags: 0
- -- line height: 16
- -- part name: Sales Tax
- ----- HyperTalk script -----
- on mouseUp
- global dollarsAndCents
- set the numberFormat to dollarsAndCents
- put the number of the target into nr
- put not highlight of bkgnd button nr into taxable
- set highlight of bkgnd button nr to taxable
- if taxable then
- show field "Sales Tax Rate"
- calcTax
- else
- hide field "Sales Tax Rate"
- put 0 into it
- put it+0 into field "Sales Tax"
- end if
- calcTotal
- end mouseUp
-
-
-
- -- part 59 (button)
- -- low flags: 00
- -- high flags: 4005
- -- rect: left=70 top=301 right=319 bottom=88
- -- title width / last selected line: 0
- -- icon id / first selected line: 0 / 0
- -- text alignment: 1
- -- font id: 0
- -- text size: 12
- -- style flags: 0
- -- line height: 16
- -- part name: Shipping
- ----- HyperTalk script -----
- on mouseUp
- global dollarsAndCents
- set the numberFormat to dollarsAndCents
- put the number of the target into nr
- put not highlight of bkgnd button nr into shipping
- set highlight of bkgnd button nr to shipping
- if shipping then
- show field "Shipping"
- else
- hide field "Shipping"
- end if
- calcTotal
- end mouseUp
-
-
-
- -- part 60 (button)
- -- low flags: 00
- -- high flags: 0000
- -- rect: left=62 top=6 right=41 bottom=98
- -- title width / last selected line: 0
- -- icon id / first selected line: 1007 / 1007
- -- text alignment: 1
- -- font id: 0
- -- text size: 12
- -- style flags: 0
- -- line height: 16
- -- part name: Print
- ----- HyperTalk script -----
- on mouseUp
- global invoiceCopies,sellToField,firstLineField,lastLineField, leadingZeros,printingInvoice
- repeat with i=1 to the number of bkgnd buttons
- hide bkgnd button i
- end repeat
- put true into printingInvoice
- repeat with i=1 to invoiceCopies
- domenu "Print Card"
- end repeat
- put false into printingInvoice
- showButtons
- end mouseUp
-
-
-
- -- part 61 (button)
- -- low flags: 00
- -- high flags: 0000
- -- rect: left=482 top=0 right=27 bottom=512
- -- title width / last selected line: 0
- -- icon id / first selected line: 20098 / 20098
- -- text alignment: 1
- -- font id: 0
- -- text size: 12
- -- style flags: 0
- -- line height: 16
- -- part name: Home
- ----- HyperTalk script -----
- on mouseUp
- visual effect iris close
- go home
- end mouseUp
-
-
-
- -- part 65 (button)
- -- low flags: 00
- -- high flags: A000
- -- rect: left=417 top=1 right=46 bottom=466
- -- title width / last selected line: 0
- -- icon id / first selected line: 11645 / 11645
- -- text alignment: 1
- -- font id: 0
- -- text size: 12
- -- style flags: 0
- -- line height: 16
- -- part name: Customer
- ----- HyperTalk script -----
- on mouseUp
- returnToCustomer
- end mouseUp
-
-
- -- part 66 (field)
- -- low flags: 01
- -- high flags: 0000
- -- rect: left=237 top=65 right=82 bottom=293
- -- title width / last selected line: 0
- -- icon id / first selected line: 0 / 0
- -- text alignment: 1
- -- font id: 3
- -- text size: 10
- -- style flags: 256
- -- line height: 13
- -- part name: Customer Number
- ----- HyperTalk script -----
- on mouseUp
- returnToCustomer
- end mouseUp
-
-
- -- part 68 (button)
- -- low flags: 00
- -- high flags: 2000
- -- rect: left=0 top=307 right=331 bottom=25
- -- title width / last selected line: 0
- -- icon id / first selected line: 1014 / 1014
- -- text alignment: 1
- -- font id: 0
- -- text size: 12
- -- style flags: 0
- -- line height: 16
- -- part name: Left Arrow
- ----- HyperTalk script -----
- on mouseUp
- -- assumes only Invoice cards between Invoice and Customer Masters
- get the number of previous card
- if it > the number of card "Invoice Master" then
- go previous card
- else
- get the number of card "Customer Master"
- if it-1 > the number of card "Invoice Master" then go card it-1
- end if
- end mouseUp
-
-
-
- -- part 69 (button)
- -- low flags: 00
- -- high flags: 2000
- -- rect: left=487 top=307 right=331 bottom=512
- -- title width / last selected line: 0
- -- icon id / first selected line: 1013 / 1013
- -- text alignment: 1
- -- font id: 0
- -- text size: 12
- -- style flags: 0
- -- line height: 16
- -- part name: Right Arrow
- ----- HyperTalk script -----
- on mouseUp
- -- assumes only Invoice cards between Invoice and Customer Masters
- get the number of next card
- if it < the number of card "Customer Master" then
- go next card
- else
- get the number of card "Invoice Master"
- if it+1 < the number of card "Customer Master" then go card it+1
- end if
- end mouseUp
-
-
-
- -- part 70 (button)
- -- low flags: 00
- -- high flags: 8000
- -- rect: left=0 top=0 right=46 bottom=53
- -- title width / last selected line: 0
- -- icon id / first selected line: 1018 / 1018
- -- text alignment: 1
- -- font id: 0
- -- text size: 12
- -- style flags: 0
- -- line height: 16
- -- part name: Delete Inv.
- ----- HyperTalk script -----
- on mouseUp
- global deleteFlag
- if checkInvoiceMaster() then exit mouseUp
- put "Invoice" into deleteFlag
- put "C"&&field "Customer Number" into customerCard
- doMenu "Delete Card"
- put empty into deleteFlag
- end mouseUp
-
-
-
- -- part 71 (button)
- -- low flags: 00
- -- high flags: 2000
- -- rect: left=482 top=26 right=53 bottom=512
- -- title width / last selected line: 0
- -- icon id / first selected line: 30557 / 30557
- -- text alignment: 1
- -- font id: 0
- -- text size: 12
- -- style flags: 0
- -- line height: 16
- -- part name: Title Card
- ----- HyperTalk script -----
- on mouseUp
- go card "Title Card"
- end mouseUp
-
-
-
- -- part 82 (field)
- -- low flags: 80
- -- high flags: 0002
- -- rect: left=103 top=2 right=60 bottom=407
- -- title width / last selected line: 0
- -- icon id / first selected line: 0 / 0
- -- text alignment: 1
- -- font id: 4
- -- text size: 12
- -- style flags: 1536
- -- line height: 16
- -- part name: Logo Frame
-